html play audio programmatically

106

play audio source on html -

<audio controls>
  <source src="myAudio.mp3" type="audio/mpeg">
  <source src="myAudio.ogg" type="audio/ogg">
  <p>Your browser doesn't support HTML5 audio. Here is
     a <a href="myAudio.mp4">link to the audio</a> instead.</p>
</audio>

html play audio programmatically -

document.getElementById('yourAudioTag').play();

Comments

Submit
0 Comments